const sequelize = require("../app/db");
const { DataTypes, Model } = require("sequelize");

class Counts extends Model {}
Counts.init(
  {
    Id: {
      type: DataTypes.INTEGER,
      allowNull: false, //不允许为空
      primaryKey: true,
      autoIncrement: true,
    },
    LickCount: {
      type: DataTypes.INTEGER,
    },
    CollectCount: {
      type: DataTypes.INTEGER,
    },
    VisitCount: {
      type: DataTypes.INTEGER,
    },
    CommentCount: {
      type: DataTypes.INTEGER,
    },
    ResourceId: {
      type: DataTypes.INTEGER,
    },
    ResourceType: {
      type: DataTypes.INTEGER,
    },
  },
  {
    sequelize,
    modelName: "Counts",
    tableName: "counts", //强制设置表名
  }
);

module.exports = Counts;
